package com.ruoyi.robot.config;
import com.influxdb.client.InfluxDBClient;
import com.influxdb.client.InfluxDBClientFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 时序数据库配置
 * @author yid
 */
@Configuration
public class InfluxdbConfig {

    private final static String TOKEN = "U3j1pvffrT0-MIl3caZoyPY8nZHJPnT3uWx_EP57XVLsMD0O8cqUif8UXLOjHBx4pHvSOoJ89FOuKPv2s5cg4w==";
    private final static String BUCKET = "example01";
    private final static String ORG = "robot";
    private final static String URL = "http://1.12.56.91:8086";

    @Bean
    public InfluxDBClient influxDbClient() {
        return InfluxDBClientFactory.create(URL, TOKEN.toCharArray(),ORG,BUCKET);
    }

}
